package demo1;

import java.util.*;
import java.util.function.BiConsumer;

class Message<T> {
    private T message ;
    public T getMessage() {
        return message;
    }
    public void setMessage(T message) {
        this.message = message;
    }
}
public class TestDemo {
    public static void main(String[] args) {
        List<Integer> list=new ArrayList<Integer>();
        list.add(1);
        list.add(3);
        list.add(6);
        list.add(2);
        list.add(4);
        list.add(9);
        list.add(0);
        list.sort((o1,o2)->o1.compareTo(o2));
        list.sort(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return 0;
            }
        });
        System.out.println(list);
        Map<Integer,Integer> map=new HashMap<>();
        map.put(1,2);
        map.put(2,2);
        map.put(5,2);
        map.put(8,2);
        map.put(9,2);
        map.put(1,2);
        map.forEach((k,v)->{
            System.out.println(k+"="+v);
            //
        });
    }
    public static void main2(String[] args) {
        int a=9;
        PriorityQueue<Integer> priorityQueue=new PriorityQueue<>(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                //a=1   不能对变量进行修改
                return o1.compareTo(o2);
            }
        });
        Integer b = 127;
        Integer c = 20000;
        Integer d = 20000;
        int e=20000;
        System.out.println(a==b);
        System.out.println(d==e);
        Queue<Integer> queue=new LinkedList<>();
    }
    public static void main1(String[] args) {
        Message<String> message = new Message<>() ;
        message.setMessage("比特就业课欢迎您");
        fun(message);
        Message<Integer> message1=new Message<>();
        message1.setMessage(123);
        fun(message1);
    }
    public static void fun(Message<?> temp){
        Object object=temp.getMessage();
        System.out.println(temp.getMessage());
    }
    public static void func(int a){

    }
}